package com.learn.springcloud.feignextendfeatureconsumer.controller;

import com.learn.springcloud.feignextendfeatureconsumer.service.RefactorHelloService;
import com.learn.springcloud.feignextendfeatureparent.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Time : 2018/8/9 11:50
 * @Version : 1.0
 */
@RestController
public class RefactorHelloController {

    @Autowired
    RefactorHelloService refactorHelloService;

    @RequestMapping(name = "/feign/extend/feature/consumer/test", method = RequestMethod.POST)
    public String test(@RequestBody User user){
        System.out.println(refactorHelloService.hello(user.getName()));
        System.out.println(refactorHelloService.hello(user.getName(),user.getAge()));
        System.out.println(refactorHelloService.hello(user));
        return "";
    }
}
